import os

import requests


from common.base import Base

class Login(Base):

    def login(self,a="/login",b={"username":"17513230010","password":"123456"}):
        ip=self.i
        uri=a
        url=f"{ip}/{uri}"
        mydata=b

        r=requests.post(url,data=mydata)
        # print(r.json())
        return r

    def gettoken(self):
        r=self.login()
        self.token = r.json()["Admin-Token"]
        return self.token


if __name__ =='__main__':
    l=Login()
    l.login()